laravel

Laravel Cartalyst/Stripe Method Not Found

随声附和 提交于 2021-02-11 07:10:53
问题 I am trying to use Cartalyst/Stripe (https://cartalyst.com/manual/stripe/2.0) in my Laravel application but I the method's aren't being found (for a lack of a better word). Here is my controller: namespace App\Http\Controllers; use Illuminate\Support\Facades\DB; use Illuminate\Http\Request; use Cartalyst\Stripe\Stripe; class AdminController extends Controller { public function __construct() { $this->middleware('auth'); } public function create_user(Request $request) { $stripe = Stripe::make(

Laravel Echo Listener not working on frontend

独自空忆成欢 提交于 2021-02-11 06:51:08
问题 I have created an event: <?php namespace App\Events; use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; class QueueStatus implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $queue; public

Getting error while migrating laravel 7 to 8

爷,独闯天下 提交于 2021-02-11 06:30:51
问题 I am using library upeg/sybase 2.1 . when I am upgrading laravel 8 , i am getting below error. How can I resolve this error? Getting error while applyig command composer update composer.json "require": { "php": "^7.3.0", "ext-curl": "*", "ext-json": "*", "abram/laravel-odbc": "dev-master", "agomez/laravel-odbc-driver": "^1.0", "alipek/rtf2html": "dev-master", "doctrine/dbal": "^2.10", "fideloper/proxy": "^4.2", "google/recaptcha": "^1.2", "guzzlehttp/guzzle": "^7.0", "laravel/framework": "^8

Using namespace in laravel view

走远了吗. 提交于 2021-02-11 06:20:18
问题 How to use namespace in laravel View? I mean I have three different folders admin , frontend and client in app/views folder. If I want to load a partial template lets say from admin section views/admin/partials/flush.blade.php in views/admin/account/profile.blade.php I have to include it like: @include('admin/partials/flush') instead I want to just use @include('partials/flush') How can i do that? 回答1: You can extend blade and write a function that fits your needs. Like this: Blade::extend

How to remove public from url in laravel

自古美人都是妖i 提交于 2021-02-11 05:54:39
问题 I want ro remove public word from the url in laravel. I tried updating .htaccess and renaming server.php to index.php file but after that I got path error. All the css, js, fonts are not working without public word in the url. Please help me so that I can set all the path of css, js, fonts and remove public word from url in laravel. Any help would be appreciable. 回答1: Move your all files from /public to your root folder / (which is mainly your laravel folder). Now open index.php file and edit

How to remove public from url in laravel

浪子不回头ぞ 提交于 2021-02-11 05:54:07
问题 I want ro remove public word from the url in laravel. I tried updating .htaccess and renaming server.php to index.php file but after that I got path error. All the css, js, fonts are not working without public word in the url. Please help me so that I can set all the path of css, js, fonts and remove public word from url in laravel. Any help would be appreciable. 回答1: Move your all files from /public to your root folder / (which is mainly your laravel folder). Now open index.php file and edit

Changing env values via controller in laravel

删除回忆录丶 提交于 2021-02-11 02:48:39
问题 Is there any ways that I could change my .env file values from controllers in laravel? I've found this answer but it returns Undefined property: App\Http\Controllers\Admin\PerformanceController::$laravel code $path = base_path('.env'); $key = false; if (file_exists($path)) { file_put_contents($path, str_replace( 'APP_KEY='.$this->laravel['config']['app.key'], 'APP_DEBUG='.$key, file_get_contents($path) )); } I want to have options in my admin panel to change debug mode between true or false,

Laravel Policy bug

与世无争的帅哥 提交于 2021-02-10 23:16:28
问题 I have used Laravel Policies successfully in the past but am having issues with one currently. In an ArticleController I have the following method: /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $this->authorize('create', Article::class); $categories = $this->categories; return view('editable.news.create', compact('categories')); } My ArticlePolicy looks like this: <?php namespace App\Policies; use Illuminate\Auth\Access

Laravel Policy bug

偶尔善良 提交于 2021-02-10 23:15:57
问题 I have used Laravel Policies successfully in the past but am having issues with one currently. In an ArticleController I have the following method: /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $this->authorize('create', Article::class); $categories = $this->categories; return view('editable.news.create', compact('categories')); } My ArticlePolicy looks like this: <?php namespace App\Policies; use Illuminate\Auth\Access

Laravel Policy bug

断了今生、忘了曾经 提交于 2021-02-10 23:15:09
问题 I have used Laravel Policies successfully in the past but am having issues with one currently. In an ArticleController I have the following method: /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $this->authorize('create', Article::class); $categories = $this->categories; return view('editable.news.create', compact('categories')); } My ArticlePolicy looks like this: <?php namespace App\Policies; use Illuminate\Auth\Access