skip to Main Content

assertSee failed due to whitespaces in html code – Laravel

In my blade, I have a button: <a href="/customer/member/delete/{{ $member->id }}" class="btn btn-secondary delete-button" > Delete </a> And I want to test it: $this->view->assertSee('<a href="/customer/member/delete/1" class="btn btn-secondary delete-button">Delete</a>'); How can I ignore whitespaces in the test? A tried: trim and…

VIEW QUESTION

Laravel errors while storing a file

I am working on a laravel crud project. Now i want to store files like .xlsx and .docx But i keep getting errors in my controller and browser: Controller: public function store(Request $request) { $request->validate([ 'title'=>'required', 'description_short'=>'', 'description_long'=>'', 'file'=>'', 'language_id'=>…

VIEW QUESTION

Laravel get value from another table based on id

I want to get department_name from department table with table department = id, department_name, total_employee table employee = id, employee_name, id_department, email, telephone, gender, status I tried model.Employee public function department() { return $this->belongsTo(Department::class); } controllers.EmployeeControllers public function index() {…

VIEW QUESTION

Pass if statement outcome to blade – Laravel

Trying to access from Controller values to my blade public function show(Template $template){ if (Save::where('user_id', '=', auth()->user()->id)->count() > 0) { if (Save::where('title', '=', $template->title)->count() > 0) { //OUTPUT - EXISTS } //OUTPUT - NOT EXISTS } return view('actions/show', [ 'template'…

VIEW QUESTION
Back To Top
Search