laravel-4

Warning: failed to open stream: No such file or directory in C:\wamp\www\laravel\bootstrap\autoload.php on line 17

眉间皱痕 提交于 2020-08-04 03:14:31
问题 Environement Windows 7 WAMP server PHP 5.3.13 Apache 2.2.12 MySQL 5.5.24 Laravel 4.1 I installed laravel, trying to run the URL http://localhost/laravel/public autoload.php define('LARAVEL_START', microtime(true)); require __DIR__.'/../vendor/autoload.php'; if (file_exists($compiled = __DIR__.'/compiled.php')){ require $compiled; } Illuminate\Support\ClassLoader::register(); if (is_dir($workbench = __DIR__.'/../workbench')){ Illuminate\Workbench\Starter::start($workbench); } I am facing the

Warning: failed to open stream: No such file or directory in C:\wamp\www\laravel\bootstrap\autoload.php on line 17

我是研究僧i 提交于 2020-08-04 03:14:20
问题 Environement Windows 7 WAMP server PHP 5.3.13 Apache 2.2.12 MySQL 5.5.24 Laravel 4.1 I installed laravel, trying to run the URL http://localhost/laravel/public autoload.php define('LARAVEL_START', microtime(true)); require __DIR__.'/../vendor/autoload.php'; if (file_exists($compiled = __DIR__.'/compiled.php')){ require $compiled; } Illuminate\Support\ClassLoader::register(); if (is_dir($workbench = __DIR__.'/../workbench')){ Illuminate\Workbench\Starter::start($workbench); } I am facing the

Composer, Laravel and local packages

最后都变了- 提交于 2020-07-17 06:47:20
问题 My issue is I have a package which isn't a repository and I am trying to get it to play nice with Laravel and composer. It is still located under the vendor folder, the only issue is that if I simply set: "psr-0": { "Test\\Test": "vendor/test/test/src/" } This will load the service provider but none of the controllers etc will autoload. What is the correct way to implement a package with larval that does not have it's own repository. Or does this go against the nature of packages and this

Issue Running Artisan Command via Cronjob

て烟熏妆下的殇ゞ 提交于 2020-07-07 10:59:39
问题 I'm having a bit of a nightmare getting a crontab/cronjob to run an Artisan command. I have another Artisan command running via cronjob no problems but this second command won't run. Firstly, when I do 'crontab -e' and edit the file to contain: 0 0 * * * /usr/local/bin/php /home/purple/public_html/artisan feeds:send The cronjob doesn't run at all. If I go to cPanel and add the cronjob there, it runs but I receive the following error: open(public/downloads/feeds/events.csv): failed to open

Issue Running Artisan Command via Cronjob

余生长醉 提交于 2020-07-07 10:56:09
问题 I'm having a bit of a nightmare getting a crontab/cronjob to run an Artisan command. I have another Artisan command running via cronjob no problems but this second command won't run. Firstly, when I do 'crontab -e' and edit the file to contain: 0 0 * * * /usr/local/bin/php /home/purple/public_html/artisan feeds:send The cronjob doesn't run at all. If I go to cPanel and add the cronjob there, it runs but I receive the following error: open(public/downloads/feeds/events.csv): failed to open

laravel eloquent relationship from query builder

感情迁移 提交于 2020-06-27 11:27:11
问题 If I do this, I would be able to retrieve the images() for the item $items = Item::all(); foreach($items as $item){ $image = $item->images()->first(); } However if I had a complex query using the query builder. I wouldn't be able to get the images() from it. Is there a way to get all the relationship data from the Eloquent Models considering this is a query builder? $items = DB::table('items as i') ->join('users AS u', 'i.user_id', '=', 'u.id') ->where('account_id', 5)->all(); foreach($items

Laravel hasMany association with multiple columns

断了今生、忘了曾经 提交于 2020-06-27 11:25:48
问题 I have two models model_1 model_2 model_1 has many model_2 Now I want to association model_1 hasMany model_2 match with multiple column. Let me give an example in raw query select ...... from model_1 left join model_2 ON (model_1.f1 = model_2.f1 AND model_1.f2 = model_2.f2) How can I do this in hasMany association 回答1: I got it to work by adding an additional parameter to join on in the model: public function my_joined_columns($mySecondJoinColumnValue) { return $this->hasMany(

How the laravel Mail::failures() function works?

空扰寡人 提交于 2020-06-27 07:12:25
问题 I've been trying to get the list of recipients who did not get email using laravel Mail::send() function. I am trying following code. for loop is used as because each user to be received customized message. // First recipient is actual, the second is dummy. $mail_to_users = ["original_account@domain.com","dummy_account@domain.com"]; $failures = []; foreach($mail_to_users as $mail_to_user) { Mail::send('email', [], function($msg) use ($mail_to_user){ $msg->to($mail_to_user); $msg->subject(

php : The term 'php' is not recognized as the name of a cmdlet, function, script file, or operable program

坚强是说给别人听的谎言 提交于 2020-06-25 09:01:26
问题 I am trying to install and setup Laravel 4 through the Git Shell using this tutorial: It all seems to be working until I have to run php artisan key:generate at which point it gives me the error: php : The term 'php' is not recognized as the name of a cmdlet, function, script file, or operable program I have hunted around and am not sure how to go about setting this up so it recognizes PHP. Does anyone have any ideas or know of a thorough tutorial to get Laravel 4 setup? 回答1: Try adding your

Laravel, Admin controllers - 403 Forbidden

你。 提交于 2020-06-25 05:58:16
问题 I am trying to create Admin controllers in the default controller folder. I have created "admin" folder in the "controller" folder. In the routes file: Route::get('/admin', 'admin/AdminController@showAdminIndex'); AdminController.php file: namespace Admin; class AdminController extends \BaseController { public function showAdminIndex() { return "Hello World"; } } I get an error on the browser: 403 Forbidden What went wrong? 回答1: The problem is that you have an admin subfolder in the public