skip to Main Content

Php – Laravel 7 can not see videos in public storage

I have a project which contains some video files in storage/app/public/homepage/ The files are really there and in html there is something like <video autoplay muted loop> <source src="http://localhost:8000/storage/homepage/vid3.mp4" type="video/mp4" /> </video> But video does not play. I tried to…

VIEW QUESTION

Unable to access user id through guard after login in laravel

I have this route defined in web.php web.php Route::group(['prefix' => 'user'], function () { Route::get('login', [FrontendController::class ,'showLoginForm'])->name('user.login-show'); Route::post('login', 'AppHttpControllersLoginController@login')->name('login.post'); } this is my login controller <?php namespace AppHttpControllers; use Auth; use AppUser; use AppHttpControllersController; use IlluminateHttpRequest; use IlluminateFoundationAuthAuthenticatesUsers; use IlluminateSupportFacadesHash;…

VIEW QUESTION

Laravel7 query wrap with "not"

How to create "NOT" wrapped criteria, ie: WHERE id=1 AND NOT (tag='foo' OR tag='bar') I know I can wrap with closure $q->where('id', 1) ->where(function ($iq) { $iq->where('tag', 'foo') ->orWhere('tag', 'bar'); }); Something like this (which does not work): $q->where('id', 1)…

VIEW QUESTION

Laravel whereJsonContains returns No Result in A whereExists Sub Query

This is my current code, when executed will return no results. (Query1) // Get all product categories that has a relation $product_categories = ProductCategory::whereExists(function($query) { $query->select('id') ->from('restaurants') ->whereJsonContains('restaurants.restaurant_categories', 'product_categories.name'); })->get(); // Log dd($product_categories->toSql()); Here an sql query dump select *…

VIEW QUESTION

Laravel Timestamp Validation

I want to make sure that the receiving data is a valid timestamp. is there a way to make sure starts_at and expired_at fields are timestamps? $rules = [ 'user_id' => 'required|int|exists:users,id', 'starts_at' => 'required|int|min:1', 'expires_at' => 'required|int|gt:starts_at', ];

VIEW QUESTION

send entity for controller not working, php laravel 7

in blade template <form action="{{ route('leads.courses.restore', $lead->id) }}" method="POST"> @csrf <button type="submit"> Restore </button> </form> in routes Route::post('leads/courses/{lead}/restore', 'LeadsCoursesController@restore')->name('leads.courses.restore'); in controller public function restore(Lead $lead) { dd("ok"); } but i receive HTTP code 404, if i remove the parameter in…

VIEW QUESTION
Back To Top
Search