laravel-4

Laravel 4: Why does my class autoload but global variables are not available

三世轮回 提交于 2021-01-26 12:01:53
问题 I've autoloaded a class, which is properly namespaced and PSR-0. I put it in app/lib/CI, and the class and it's filename are the same "DB". The class file itself includes a config file before the actual class: require( 'config.php' ); class DB { // ... } The class is clearly autoloading, because when I call the static method connect it does display an error message from inside ::connect(). The problem is, global variables that are inside the included config.php are not available inside the

Laravel 4: Why does my class autoload but global variables are not available

孤街醉人 提交于 2021-01-26 12:01:13
问题 I've autoloaded a class, which is properly namespaced and PSR-0. I put it in app/lib/CI, and the class and it's filename are the same "DB". The class file itself includes a config file before the actual class: require( 'config.php' ); class DB { // ... } The class is clearly autoloading, because when I call the static method connect it does display an error message from inside ::connect(). The problem is, global variables that are inside the included config.php are not available inside the

Laravel artisan cron not working

≯℡__Kan透↙ 提交于 2021-01-22 11:53:51
问题 I have got a page which queues up emails in beanstalked. The script works as intended, the emails get fired when i have a queue listener, ie. php artisan queue:listen But when i remove the listener and add it to the crob job * * * * * /usr/bin/php /var/www/huge/artisan queue:listen The emails don't get fired. Any ideas? 回答1: Had this exact same issue the other day, you probably just need to cd in to the directory where Artisan is located first. Try the following: * * * * * cd /var/www/huge/ &

Laravel search query with multiple conditions

北城以北 提交于 2020-12-27 08:12:36
问题 Newbie to PHP/Laravel here so please be patient. I have a webpage that is searching based on 3 criteria for dogs , breed, sex and radius. here is the relevant code: search page <div class="col-md-12 zero-pad-left zero-pad-right"> {{ Form::open(array('action' => array('DogsController@index'), 'class'=>'form width88', 'role'=>'search', 'method' => 'GET')) }} <div id="prefetch"> {{ Form::text('search-breed', null, array('class' => 'typeahead form-group form-control', 'placeholder' => 'Search by

Laravel search query with multiple conditions

扶醉桌前 提交于 2020-12-27 08:09:33
问题 Newbie to PHP/Laravel here so please be patient. I have a webpage that is searching based on 3 criteria for dogs , breed, sex and radius. here is the relevant code: search page <div class="col-md-12 zero-pad-left zero-pad-right"> {{ Form::open(array('action' => array('DogsController@index'), 'class'=>'form width88', 'role'=>'search', 'method' => 'GET')) }} <div id="prefetch"> {{ Form::text('search-breed', null, array('class' => 'typeahead form-group form-control', 'placeholder' => 'Search by

Laravel search query with multiple conditions

扶醉桌前 提交于 2020-12-27 08:09:19
问题 Newbie to PHP/Laravel here so please be patient. I have a webpage that is searching based on 3 criteria for dogs , breed, sex and radius. here is the relevant code: search page <div class="col-md-12 zero-pad-left zero-pad-right"> {{ Form::open(array('action' => array('DogsController@index'), 'class'=>'form width88', 'role'=>'search', 'method' => 'GET')) }} <div id="prefetch"> {{ Form::text('search-breed', null, array('class' => 'typeahead form-group form-control', 'placeholder' => 'Search by

Laravel Group By Date

旧时模样 提交于 2020-12-26 04:31:00
问题 I am trying to make an elqouent query for a following sql, select sum(w.total_item_count) as Day_count, w.created_at as created_at from `sales_flat_orders` as `w` group by DATE(`w`.`created_at`) order by `w`.`created_at` asc and I have tried this $orderbydate = DB::table('sales_flat_orders as w') ->select(array(DB::Raw('sum(w.total_item_count) as Day_count'),DB::Raw('DATE(w.created_at) as created_at'))) ->groupBy('w.created_at') ->orderBy('w.created_at') ->get(); I am getting correct output

Laravel Group By Date

99封情书 提交于 2020-12-26 04:27:07
问题 I am trying to make an elqouent query for a following sql, select sum(w.total_item_count) as Day_count, w.created_at as created_at from `sales_flat_orders` as `w` group by DATE(`w`.`created_at`) order by `w`.`created_at` asc and I have tried this $orderbydate = DB::table('sales_flat_orders as w') ->select(array(DB::Raw('sum(w.total_item_count) as Day_count'),DB::Raw('DATE(w.created_at) as created_at'))) ->groupBy('w.created_at') ->orderBy('w.created_at') ->get(); I am getting correct output

Laravel Redis Session Driver doesn't work

落花浮王杯 提交于 2020-12-05 08:32:13
问题 I'm having difficulties using the laravel 4 "redis" session driver. The problem is nothing gets actually stored. Things i've checked: I've set the driver to redis in Session-config file and cache-config file In database-config file a database config for redis is specified: I tried storing something manually with the redis-class, that did work, storing with the session class did not work // this is in my session config 'driver' => 'redis', //this is my db-config 'redis' => array( 'cluster' =>

Laravel/Cashier invoices() returns empty Object

心不动则不痛 提交于 2020-12-01 13:30:44
问题 I've got a problem with the cashier package from Taylor (https://github.com/laravel/cashier). When I try to get the Invoices for a User the Object that is returned is Empty. For information i've set up my cashier database columns into a membership table! And then set up the proper relationships. I can charge the User if I do something like this: $user->membership->subscription('1month')->create($token); But if I want to get the invoices like so $invoices = $user->membership->invoices(); it