laravel-4

CSS Images, Images, and Fonts in Laravel 4 Framework

依然范特西╮ 提交于 2019-12-13 06:31:18
问题 I am having some trouble with a few things with the Laravel 4 Framework. First, to give the setup, I have an assets folder, within my public folder, that contains a folder for css called "CSS", a folder for images called "images", and a folder for fonts called "webfonts". Here are the paths: /laravel-master/public/assets/CSS /laravel-master/public/assets/images /laravel-master/public/assets/webfonts Inside the CSS folder is my main CSS file, style.css. I am trying to use an image as a

Dynamically change div CSS background using JS within blade foreach loop

旧街凉风 提交于 2019-12-13 06:24:15
问题 I am trying to display user created images on a photos.index view using Laravel 4. As you can see below I am using foreach to go through those pictures. However, as I want to have them displayed in boxes 300px height and 300px width I am using the css background method "cover" in my "box" class. Now I hav to use JS to change the background image of every box according to what is inserted in the database. The code below gives me the following result: There are as much boxes displayed as I have

Laravel 4.1, how to compare image height and width within a function

跟風遠走 提交于 2019-12-13 06:00:54
问题 I am trying to determine in which way an image has to be cropped to fit perfectly as a square user profile image. I have discovered the Laravel package "intervention image" but as far as I can see this one does not offer a function to compare whether an image is horizontal or vertical. http://intervention.olivervogel.net/ Is there any good way to determine whether the image is a square or horizontal or vertical before resizing and cropping it? This is what I do at the moment: $img->resize(400

PHPSpec and Laravel - how to handle double method not found issues

岁酱吖の 提交于 2019-12-13 05:59:06
问题 I appear to be having issues with my spec tests when it comes to stubs that are calling other methods. I've been following Laracasts 'hexagonal' approach for my controller to ensure it is only responsible for the HTTP layer. Controller <?php use Apes\Utilities\Connect; use \OAuth; class FacebookConnectController extends \BaseController { /** * @var $connect */ protected $connect; /** * Instantiates $connect * * @param $connect */ function __construct() { $this->connect = new Connect($this,

How to show errors in client side in Laravel

安稳与你 提交于 2019-12-13 05:36:40
问题 How can I show errors in client side with Laravel controller in Laravel 4.2? I want to show this error: D:\xampp\htdocs\guestlara\app\views\index.php(51): Illuminate\Exception\Handler->handleError(8, 'Undefined varia...', 'D:\xampp\htdocs...', 51, Array) public function login_user() { $rules = array( 'email'=> 'Required|Between:3,64|Email|Unique:users', 'password'=>'Required|AlphaNum|Between:4,8|Confirmed', ); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { //

Laravel 4 does not extend Eloquent class

[亡魂溺海] 提交于 2019-12-13 05:30:31
问题 I have a Product.php file in app/models folder. Here is the content of the file: class Product extends Eloquent{ protected $table = 'productinfo'; } However, when I tried to run $product = Product::all(); , Laravel say Call to undefined method Product::all() . It seems like Eloquent class is not extended. I don't see anything I do wrong here. Why does it not working? Could it be any other configuration in Laravel which I mess up? --update-- After renaming the Product.php file, it is now no

how to show errors to client side

隐身守侯 提交于 2019-12-13 05:25:28
问题 D:\xampp\htdocs\guestlara\app\views\index.php(51): Illuminate\Exception\Handler->handleError(8, 'Undefined varia...', 'D:\xampp\htdocs...', 51, Array) Page showing above error. How to show this to client public function login_user() { $rules = array( 'email'=> 'Required|Between:3,64|Email|Unique:users', 'password'=>'Required|AlphaNum|Between:4,8|Confirmed', ); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { // get the error messages from the validator $messages

LARAVEL default page not loading - Error 324 - ERR_EMPTY_RESPONSE

99封情书 提交于 2019-12-13 05:19:02
问题 +Apache2 +PHP5.5 +Laravel4 After installing laravel, I go to http://localhost and chrome gives me an ERR_EMPTY_RESPONSE error. If I create in the public folder an index2.php file that just echo "hello", it works fine! Everytime I try to access localhost, a line like this is added in the Apache's log: [Sat Jul 26 14:38:37.083511 2014] [core:notice] [pid 9562] AH00051: child pid 10025 exit signal Segmentation fault (11), possible coredump in /etc/apache2 and this crash happens: http://s13

Laravel Datepicker And Eloquent Query

雨燕双飞 提交于 2019-12-13 05:17:05
问题 I am making a page where I can use the date ranger, datepicker from jqueryui.com and i am very mewbie to laravel Framework. I have the eloquent query as follows, public function orderbydate() { $order =DB::table('sales_flat_order_items as s') ->leftJoin('sales_flat_orders as w', 'w.entity_id','=','s.order_id') ->select(array(DB::Raw('sum(s.amount_refunded) as amount_refunded'), DB::Raw('sum(s.row_total) as row_total'), DB::Raw('sum(s.discount_amount) as discount_amount'), DB::Raw('sum(s.tax

PHP artisan serve shuts down after running once

别等时光非礼了梦想. 提交于 2019-12-13 05:13:39
问题 I'm using Laravel 4, running php 5.4 and MAMP, and have cloned this repo but for some reason php artisan serve shuts down after running one time ( localhost:8000 runs once, then stops, then I have to use php artisan serve to run it again ). Any ideas to keep it from shutting down? Here is where this question originated. 回答1: I had the same problem and I think I've finally found a solution. In MAMP, try turning off XCache. This solved it for me. From the MAMP dialog, go to Preferences->PHP .