This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dhb528693
dhb528693

Although there's a solution for bringing back Laravel as plugin, https://github.com/daftspunk/oc-laravelapi-plugin

But I still miss the NATIVE laravel app directory, where I can use the official artisan. That makes creating controllers, referencing views/assets more easily, further more the Elixir functionality.

Thanks.

daftspunky
daftspunky

Laravel seems to change their minds about the structure of an /app directory so October ships as BYOAD (Bring Your Own App Directory).

To bring across the most recent structure offered by Laravel, simply copy and paste the /app directory from the Laravel repo.

Then open the file bootstrap\app.php to update the singleton references for each Kernel and Exception handler to the ones found in the /app folder.

Then open each of the referenced files and ensure they extend the October\Rain\Foundation library instead of the Illuminate\Foundation library.

All done.

gyao8914
gyao8914

Hi, good explanation about the BYOAD feature. My question on top of that is : does october overwrite laravel 5 modules? or is it 100% built on TOP of those modules? I'm wondering because i have a laravel 5 app that's half finished but am thinking of incorporating into october cms. Whats your take on this, is this a good idea? Any suggestions would be awesome, thanks!

jerry3850
jerry3850

I did as daftspunk instructs above and got the following error message:

Fatal error: Uncaught exception 'ReflectionException' with message 'Class App\Http\Kernel does not exist' in C:\xampp\htdocs\xxxxx\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 779

This is what I did specifically:

(1) I copied in the /app directory from the Laravel repo.

(2) In bootstrap/app.php, I updated the singleton references for each Kernel and Exception handler as follows:

 $app->singleton(
     'Illuminate\Contracts\Http\Kernel',
     'App\Http\Kernel'               // <-- Used to be October\Rain\Foundation\Http\Kernel
 );

$app->singleton(
    'Illuminate\Contracts\Console\Kernel',
    'App\Console\Kernel'               // <-- Used to be October\Rain\Foundation\Console\Kernel
);

$app->singleton(
    'Illuminate\Contracts\Debug\ExceptionHandler',
    'App\Exception\Handler'               // <-- Used to be October\Rain\Foundation\Exception\Handler
);

(3) I modified the referenced files to ensure they extend the October\Rain\Foundation library instead of the Illuminate\Foundation library. As an example, here is how I changed app/Http/Kernal.php:

<?php

namespace App\Http;

use October\Rain\Foundation\Http\Kernel as HttpKernel;  // <-- Used to be Illuminate\Foundation\Http\Kernel

class Kernel extends HttpKernel
{
    etc...
}

What did I do wrong?

Last updated

daftspunky
daftspunky

The error message is quite specific and it suggests that you need to run the composer command:

composer dump-autoload

This is because Laravel uses PSR-4 for autoloading classes.

athamidn14211
athamidn14211

after dump-autoload yet :

Fatal error: Uncaught exception 'ReflectionException' with message 'Class app\Http\Kernel does not exist' in

why?

viral-vector
viral-vector

One note to add to this. Ran into issues with plugin set scheduled commands. As in the system will not register or glum-up commands scheduled within a plugin registerSchedule method.

To combat this, in my setup

App\Console\Kernel extends October\Rain\Foundation\Console\Kernel. 

In my schedule method i placed

parent::schedule($schedule);

1-7 of 7

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.